<?php $header=$this->action('ZfcAdmin\Controller\AdminController', 'headerAction');
	  $baseUrl = $header->headerarray['baseUrl'];
?>
<?php if(isset($_SESSION['admin'])){?>
<html>
	<center>
		<head>
			<?php if(isset($_GET['radius_id']) && $_GET['radius_id']!=""){?>
			<h1>Edit Radius</h1>
			<?}else{?>
			<h1>Add Radius</h1>
			<?}?>
		</head><br/>
		<body>
			<form id="add_radius_form" name="add_radius_form" method="post" action="">
				Distance:
				<? if(isset($this->radius_details->distance) && $this->radius_details->distance!=""){?>
				<select id="distance" name="distance">					
					<option value=''>Select a distance</option>
					<? for($i=1;$i<=10;$i++){ if($this->radius_details->distance==$i){?>					
						<option value="<? echo $i;?>" selected="selected"><? echo $i;?>km(s)</option>
					<?}else{?>
						<option value="<? echo $i;?>"><? echo $i;?>km(s)</option>
					<?}}?>				
				</select>
				<?}else{?>
					<select id="distance" name="distance">					
					<option value=''>Select a distance</option>
					<? for($i=1;$i<=10;$i++){?>					
						<option value="<? echo $i;?>"><? echo $i;?>km(s)</option>
					<?}?>				
				</select>
				<?}?><br/><br/>
				Amout for distance: <input type="text" name="distance_amount" value="<? if(isset($this->radius_details->amount_for_disatnce) && $this->radius_details->amount_for_disatnce!=""){echo $this->radius_details->amount_for_disatnce;}else{}?>" id="distance_amount" placeholder="Please enter distance amount"><br/><br/>
				<a href="<? echo $baseUrl.'admin/radius-lists'?>">Back</a>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" id="btn_rds" name="btn_rds" value="Submit" onClick="return add_radius();">
				<input type="hidden" id="hid_radius" name="hid_radius" value="<? if(isset($this->radius_details->radius_id) && $this->radius_details->radius_id!=""){echo $this->radius_details->radius_id;}else{}?>">
			</form>
		</body>
	</center>
</html>
<? } else {?>
<script>
	window.location=ADMIN_BASE_URL+'admin';
</script>
<?}?>

